package com.jlpay.openapi.demo.base;

import com.jlpay.open.jlpay.sdk.java.model.base.request.MatchingCardbinRequest;
import com.jlpay.open.jlpay.sdk.java.model.base.response.MatchingCardbinResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 银行卡bin信息
 *
 * @author zhangyongfeng
 * @date 2025/7/21
 */
public class MatchingCardbinService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MatchingCardbinService.class);

    public static void main(String[] args) {
        MatchingCardbinRequest request = buildRequest();
        MatchingCardbinResponse response = JlpayOpenApiService.openMerchService()
                .post(request, MatchingCardbinResponse.class);

        LOGGER.info("银行卡bin信息响应:{}", JsonUtils.toString(response));
    }

    private static MatchingCardbinRequest buildRequest() {
        MatchingCardbinRequest request = new MatchingCardbinRequest();
        request.setCardNo("6228481828196XXXXXX");
        return request;
    }
}
